package com.jiehoo.elove.service;

import java.io.IOException;
import javax.servlet.http.*;

@SuppressWarnings("serial")
public class BaseService extends HttpServlet {
	public void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws IOException {
		if (isValid(req)) {
			execute(req,resp);
		}
	}
	
	protected void execute(HttpServletRequest req, HttpServletResponse resp)
	{
		
	}

	public boolean isValid(HttpServletRequest req) {
		String adminAccount = req.getParameter("adminAccount");
		String adminToken = req.getParameter("adminToken");
		if (adminAccount != null && adminToken != null
				&& adminAccount.equals("admin.elove.jiehoo") && adminToken.equals("eL0ve@"))
			return true;
		else
			return false;
	}
}
